import request from '@/utils/request'
const HOSP_HOSPITAL_URL = '/admin/hosp/hospital/'

export default {

  /**
   * 分页查询
   * @param page
   * @param limit
   * @param searchObj
   */
  getHospList(page, limit, searchObj) {
    return request({
      url: HOSP_HOSPITAL_URL + `list/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  /**
   * 根据字典编号插叙所有节点
   * @param dictCode
   */
  findByDictCode(dictCode) {
    return request({
      url: `/admin/cmn/dict/findByDictCode/${dictCode}`,
      method: 'get'
    })
  },
  /**
   * 根据ID查询子节点
   * @param id
   */
  findChildById(id) {
    return request({
      url: `/admin/cmn/dict/findChildData/${id}`,
      method: 'get'
    })
  },
  /**
   * 根据id更新状态
   * @param id
   * @param status
   */
  updateStatus(id, status) {
    return request({
      url: HOSP_HOSPITAL_URL + `updateStatus/${id}/${status}`,
      method: 'get'
    })
  },
  /**
   * 获取医院详情
   * @param id id
   */
  getHospById(id) {
    return request ({
      url: HOSP_HOSPITAL_URL + `show/${id}`,
      method: 'get'
    })
  },
  /**
   * 根据科室编号查询科室列表
   * @param hospCode
   */
  getDeptList(hospCode) {
    return request({
      url: `/admin/hosp/department/getDeptList/${hospCode}`,
      method: 'get'
    })
  }

}
